package com.widget;

public class UsedTotalTime {

    public static void main(String[] args) {
        long time = (1000 * 60 * 60) * 372 + 1000 * 60 * 3;
        System.out.println(getGapTime(time));
    }

    /**
     * 获得总时间
     *
     * @param time
     * @return
     */
    public static String getGapTime(long time) {
        long hours = time / (1000 * 60 * 60);
        long minutes = (time - hours * (1000 * 60 * 60)) / (1000 * 60);
        String diffTime = "";
        if (minutes < 10) {
            diffTime = hours + ":0" + minutes;
        } else {
            diffTime = hours + ":" + minutes;
        }
        return diffTime;
    }
}
